<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge，chrome=1">

    <title>学生管理</title>

    <link rel="stylesheet" href="/static/css-lib/bootstrap.min.css" />
</head>
<body>
    <div class="container-fluid">
        <div class="row">
            <div class="well well-sm">
                <button id="addStudent" type="button" class="btn btn-default">新增</button>
            </div>
        </div>

        <div class="row">
            <div class="table-responsive">
                <table class="table table-bordered table-hover table-condensed">
                    <thead>
                        <tr>
                            <th>序号</th>
                            <th>学生</th>
                            <th>学校</th>
                            <th>年级</th>
                            <th>家长</th>
                            <th>科目</th>
                            <th>手机</th>
                            <th>QQ</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        <c:forEach var="StudentInfo" items="${StudentInfoList}" varStatus="status">
                            <tr>
                                <td>${status.count}</td>
                                <c:choose>
                                    <c:when test="${empty StudentInfo.realName}">
                                        <td>${StudentInfo.name}</td>
                                    </c:when>
                                    <c:otherwise>
                                        <td>${StudentInfo.realName}</td>
                                    </c:otherwise>
                                </c:choose>
                                <td>${StudentInfo.school}</td>
                                <td></td>
                                <td></td>
                                <td></td>
                                <td>${StudentInfo.phone}</td>
                                <td>${StudentInfo.QQ}</td>
                                <td id="<c:out value="${StudentInfo.id}" />">
                                    <button type="button" class="btn btn-default">详情</button>
                                    <button type="button" class="btn btn-default">管理</button>
                                </td>
                            </tr>
                        </c:forEach>
                    </tbody>
                </table>
            </div>
        </div>
    </div>

    <script>
        (function () {
            "use strict";

            let addStudent = document.getElementById("addStudent");
            addStudent.onclick = function () {
                window.top.changeIframe("/admin/frame/addStudent");
            }
        })();
    </script>
</body>
</html>